/*
 * Copyright (c) 2006, 2022, webrx.cn All rights reserved.
 *
 */
package cn.webrx;

import java.util.Calendar;
import java.util.Date;
import java.util.Random;

/**
 * <p>Project: jse2204 - C9
 * <p>Powered by webrx On 2022-09-08 10:19:34
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */
public class C9 {
    public static void main(String[] args) {
        System.out.println("---1");
        m1();

        System.out.println("---2");
        m1();

        System.out.println("---3");
        m1();

        System.out.println(format(new Date()));

        Calendar c = Calendar.getInstance();
        c.set(1985,Calendar.MAY,15);
        System.out.println(format(c));



    }

    public static void getNum(){
        System.out.println("hello world");
    }

    public static String format(Calendar d){
       return format(d.getTime());
    }

    public static String format(Date d){
        String str = String.format("%tF %<tT %<tA",d);
        return str;
    }


    public static void m1() {
        Random rand = new Random();
        System.out.println("hello1");
        if (rand.nextBoolean()) return;
        System.out.println("hello2");
        if (rand.nextBoolean()) return;
        System.out.println("hello3");
        if (rand.nextBoolean()) return;
        System.out.println("hello4");
    }
}
